﻿<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>会员登录-拍拍贷</title>
    <link rel="shortcut icon" href="https://www.ppdaicdn.com/favicon.ico" type="image/x-icon"/>
    <link href="/css/basic.min_0fa24dbb3be905897536f38ef8bb0db6.css" rel="stylesheet"/>
    <link href="/css/layout.min_db12a2793488e42e42b7d3156750edaa.css" rel="stylesheet"/>
    <link href="/css/ac_loginregist.min_2017112801.css" rel="stylesheet"/>
    <style type="text/css">
        .footer_footerBottomNav {
            width: 600px;
        }
    </style>
</head>
<body>
<!--头部-->
<div class="mainNav">
    <div class="mainNav_inner clearfix w1000center">
        <h1 class="logo">
            <a href="https://www.ppdai.com">
                <img src="/picture/logo.png" alt="ppdai logo"/>
            </a>
        </h1>
    </div>
</div>
<!--头部结束-->
<div class="main" style="height: 844px!important;">
    <div class="acLoginBox w1000center clearfix">
        <div class="imgbg">
            <ul>
                <li>
                    <img src="/picture/img_logo1.jpg" alt="ppdai logo"/>
                </li>
            </ul>
        </div>
        <div class="Login">
            <input type="hidden" name="Redirect" id="Redirect" value=""/>

            <div class="pclogin">
                <div class="loginTab clearfix">
                    <div class="loginByPassword cur">
                        密码登录
                    </div>
                    <div class="loginByPhone">
                        邮箱动态密码登录
                    </div>
                </div>

                <div class="loginpanel">
                    <div class="innerLoginBox clearfix">
                        <form>
                            <div id="wraploginErrorMessage" class="wraploginErrorMessage">

                            </div>
                            <ul class="login_nav">
                                <li class="clearfix">
                                    <input type="text" name="UserName" id="UserName" class="name" th:value="${newLoginName}"
                                           placeholder="请输入登录名" jumptarget="Password" jumpflag="false"
                                           tabindex="1" dta="name"/>
                                </li>
                                <li class="clearfix" id="liPwd">
                                    <input type="password" name="Password" id="Password" class="pass" autocomplete="off"
                                           value="" placeholder="密码" jumptarget="login_btn" jumpflag="true"
                                           tabindex="2"/>
                                </li>
                                <li class="clearfix">
                                    <p id="loginMsg" style="color: red;text-align: center"></p>
                                </li>
                                <li>
                                    <input type="button" id="loginBtn" class="lgn login_btn" value="立 即 登 录"
                                           tabindex="4"/>
                                </li>
                                <li class="mb10">
                                    <a href="/regist"
                                       style="margin-right: 30px;">免费注册</a>
                                </li>
                            </ul>
                        </form>
                    </div>

                    <div class="innerLoginBox clearfix" style="display:none;">
                        <form>
                            <input type="hidden" name="RedirectURL" id="RedirectURL" value=""/>
                            <div id="smsloginErrorMessage" class="wraploginErrorMessage">

                            </div>
                            <!--隐藏域保存获取到的动态验证码-->
                            <input type="hidden" id="code"/>
                            <ul class="login_nav">
                                <li class="clearfix">
                                    <input type="email" name="email" id="email" class="name" placeholder="已绑定邮箱"
                                           tabindex="5"
                                           dta="name" jumptarget="ImgValidateCode" jumpflag="false"/>
                                </li>
                                <li class="clearfix" id="liPwd2">
                                    <input type="text" name="emailCode" class="emailCode"
                                           id="emailCode"
                                           placeholder="动态验证码"/>
                                    <p id="codeMsg" style="color: red;text-align: center"></p>
                                    <input type="button" id="getCode" class="ml5 getPhoneValidateCode" value="点击获取" tabindex="8"/>
                                </li>
                                <li>
                                    <input type="button" id="smsloginBtn" class="lgn login_btn" value="立 即 登 录"
                                           tabindex="4"/>
                                </li>
                                <li class="mb10">
                                    <a href="/regist" style="margin-right: 30px;">免费注册</a>
                                </li>
                            </ul>
                        </form>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<div class="footer">
    <div class="footer_footerBottom">
        <ul class="footer_footerBottomNav clearfix">
            <li><span class="webindex"></span><a href="http://www.ppdai.com/">网站首页</a>|</li>
            <li><span class="aboutus"></span><a href="http://www.ppdai.com/help/aboutus">关于我们</a>|</li>
            <li><span class="mapsite"></span><a href="http://www.ppdai.com/home/sitemap">网站地图</a>|</li>
            <li><span class="webservice"></span><a href="https://help.ppdai.com/">帮助中心</a></li>
        </ul>
        <p>Copyright Reserved 2007-2019©拍拍贷（www.ppdai.com）&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;沪ICP备05063398号-4&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;上海拍拍贷金融信息服务有限公司</p>
    </div>
</div>

<script type="text/javascript" src="/js/ppd_newrefer.min.js"></script>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="/js/jquery.cookie.min.js"></script>
<script type="text/javascript"
        src="/js/init.min_570f0b3b8d9291d35ab328b1674e8f73.js"></script>
<script type="text/javascript"
        src="/js/ppd_ac_login.min_715f58b50ca17f3adc13ea202d873251.js"></script>
<script src="/js/aaca66af876d4e90a2ae875f93408056.js" type="text/javascript"></script>


<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "//hm.baidu.com/hm.js?f87746aec9be6bea7b822885a351b00f";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();


    $(function () {

        //点击获取邮箱动态验证码
        $("#getCode").click(function () {
            var email = $("#email").val();
            $.ajax({
                "url": "/login/getCode",
                "type": "post",
                "data": {"email": email},
                "dataType": "text",
                success: function (data) {
                    $("#code").val(data);
                },
                error: function (e) {
                    alert("获取动态验证码异常");
                }
            });
        });

        //邮箱验证登录
        $("#smsloginBtn").click(function () {
            var email = $("#email").val();
            var emailCode = $("#emailCode").val();
            var code = $("#code").val();
            if (emailCode != code) {
                $("#codeMsg").html("验证码不正确")
            } else {
                $.ajax({
                    "url":"/login/doLoginByEmail",
                    "type":"post",
                    "data":{"email": email},
                    "dataType":"json",
                    success: function (data) {
                        if (data.success) {
                            window.location.href = data.url;
                            //登录成功
                            $("#codeMsg").html(data.msg);
                        } else {
                            $("#codeMsg").html(data.msg);
                        }
                    },
                    error: function (e) {
                        alert("邮箱验证登录ajax异常")
                    }
                });
            }
        });



        //普通登录
        $("#loginBtn").click(function () {
            var userName = $("#UserName").val();
            var password = $("#Password").val();
            $.ajax({
                "url": "/login/doLogin",
                "type": "post",
                "data": {"userName": userName, "password": password},
                "dataType": "json",
                success: function (data) {
                    if (data.success) {
                        window.location.href = data.url;
                        //登录成功
                        $("#loginMsg").html(data.msg);
                    } else {
                        $("#loginMsg").html(data.msg);
                    }
                },
                error: function () {
                    alert("ajax异常");
                }
            });
        });


    });

</script>

</body>
</html>
